package com.examples.springboot.jpa.pojos;

import com.examples.springboot.jpa.domain.Department;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Builder
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DepartmentDto {

  private long id;
  private String name;

  public DepartmentDto(Department department)
  {
    this(department.getId(),
        department.getName());
  }

  @Override
  public String toString() {
    return name;
  }
  
}
